﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace Tanks
{
    public class Tanks
    {
        private  Texture2D Tank;
        private Texture2D Turret;
        public Vector2 Location = new Vector2(10,10);
        public  float TurretRotation;
        public float BodyRoation;
        public Vector2 TankVector;
        

        public virtual void Load(ContentManager Content)
        {
           Tank = Content.Load<Texture2D>("Tanks//TANK");
           Turret = Content.Load<Texture2D>("Tanks//GunTurret");
        }
        public virtual void Update(GameTime time)
        {
            if (BodyRoation > 6.3)
            {
                BodyRoation = 0;
            }
            Location += TankVector;
        }
        public virtual void Draw(SpriteBatch Sprties)
        {
          
            Sprties.Draw(Turret,Location , null, Color.White, TurretRotation, new Vector2(Tank.Width / 2, Tank.Height / 2), 0.5f, SpriteEffects.None, 0);
            Sprties.Draw(Tank, Location, null, Color.White, BodyRoation, new Vector2(Tank.Width / 2, Tank.Height / 2), 0.5f, SpriteEffects.None, 0);
        }
    }
}
